import request from '@/http/request';
import type { IDept } from '@/types/api';

export default {
    /**获取所有部门列表
     * @param params
     * @returns
     */
    getDeptsList(params?: IDept.Params) {
        return request.get<IDept.DeptItem[]>('/depts/list', params);
    },

    /**创建部门
     * @param params
     * @returns
     */
    createDept(params: IDept.CreateParams) {
        return request.post('/depts/create', params);
    },
    /**编辑部门
     * @param params
     * @returns
     */
    editDept(params: IDept.EditParams) {
        return request.post('/depts/edit', params);
    },
    /**删除部门
     * @param params
     * @returns
     */
    deleteDept(params: IDept.DeleteParams) {
        return request.post('/depts/delete', params);
    }
};
